// import com.alibaba.druid.sql.ast.*;
// import com.alibaba.druid.sql.ast.statement.SQLSelect;
// import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
// import com.alibaba.druid.sql.dialect.oracle.ast.expr.OracleExpr;
// import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;
#pragma once
#include "../OracleSQLObjectImpl.h"
#include "../../../../ast/SQLExprImpl.h"
#include "../../../../ast/SQLReplaceable.h"
#include "../expr/OracleExpr.h"

class ModelClause_CellReferenceOption
{
public:
  static ModelClause_CellReferenceOption_ptr IgnoreNav;
  static ModelClause_CellReferenceOption_ptr KeepNav;
  static ModelClause_CellReferenceOption_ptr UniqueDimension;
  static ModelClause_CellReferenceOption_ptr UniqueSingleReference;

  string_ptr name;
  uint64_t mask;

  ModelClause_CellReferenceOption();

  ModelClause_CellReferenceOption(uint64_t mask, string_ptr name);

  string_ptr toString();
};

class ModelClause_ReturnRowsClause : virtual public OracleSQLObjectImpl
{
public:
  BOOL_ptr all;

  SHAREDOBJECT(ModelClause_ReturnRowsClause);
  BOOL_ptr isAll();

  void setAll(BOOL_ptr all);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_ReferenceModelClause : virtual public OracleSQLObjectImpl
{
public:
  SQLExpr_ptr name;
  SQLSelect_ptr subQuery;
  ModelClause_CellReferenceOption_list_ptr cellReferenceOptions;

  ModelClause_ReferenceModelClause();
  SHAREDOBJECT(ModelClause_ReferenceModelClause);

  ModelClause_CellReferenceOption_list_ptr getCellReferenceOptions();

  SQLExpr_ptr getName();

  void setName(SQLExpr_ptr name);

  SQLSelect_ptr getSubQuery();

  void setSubQuery(SQLSelect_ptr subQuery);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_ModelColumnClause : virtual public OracleSQLObjectImpl
{
public:
  ModelClause_QueryPartitionClause_ptr queryPartitionClause;
  string_ptr alias;
  ModelClause_ModelColumn_list_ptr dimensionByColumns;
  ModelClause_ModelColumn_list_ptr measuresColumns;
  ModelClause_ModelColumnClause();
  SHAREDOBJECT(ModelClause_ModelColumnClause);
  ModelClause_ModelColumn_list_ptr getDimensionByColumns();

  ModelClause_ModelColumn_list_ptr getMeasuresColumns();

  ModelClause_QueryPartitionClause_ptr getQueryPartitionClause();

  void setQueryPartitionClause(ModelClause_QueryPartitionClause_ptr queryPartitionClause);

  string_ptr getAlias();

  void setAlias(string_ptr alias);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_ModelColumn : virtual public OracleSQLObjectImpl
{
public:
  SQLExpr_ptr expr;
  string_ptr alias;

  SHAREDOBJECT(ModelClause_ModelColumn);
  SQLExpr_ptr getExpr();

  void setExpr(SQLExpr_ptr expr);

  string_ptr getAlias();

  void setAlias(string_ptr alias);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_QueryPartitionClause : virtual public OracleSQLObjectImpl
{
public:
  SQLExpr_list_ptr exprList;
  ModelClause_QueryPartitionClause();
  SHAREDOBJECT(ModelClause_QueryPartitionClause);
  SQLExpr_list_ptr getExprList();

  void setExprList(SQLExpr_list_ptr exprList);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_MainModelClause : virtual public OracleSQLObjectImpl
{
public:
  SQLExpr_ptr mainModelName;
  ModelClause_ModelColumnClause_ptr modelColumnClause;

  ModelClause_CellReferenceOption_list_ptr cellReferenceOptions;
  ModelClause_ModelRulesClause_ptr modelRulesClause;
  ModelClause_MainModelClause();
  SHAREDOBJECT(ModelClause_MainModelClause);
  ModelClause_ModelRulesClause_ptr getModelRulesClause();

  void setModelRulesClause(ModelClause_ModelRulesClause_ptr modelRulesClause);

  ModelClause_CellReferenceOption_list_ptr getCellReferenceOptions();

  ModelClause_ModelColumnClause_ptr getModelColumnClause();

  void setModelColumnClause(ModelClause_ModelColumnClause_ptr modelColumnClause);

  SQLExpr_ptr getMainModelName();

  void setMainModelName(SQLExpr_ptr mainModelName);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_ModelRulesClause : virtual public OracleSQLObjectImpl
{
public:
  ModelClause_ModelRuleOption_list_ptr options;
  SQLExpr_ptr iterate;
  SQLExpr_ptr until;
  ModelClause_CellAssignmentItem_list_ptr cellAssignmentItems;
  ModelClause_ModelRulesClause();
  SHAREDOBJECT(ModelClause_ModelRulesClause);
  SQLExpr_ptr getUntil();

  void setUntil(SQLExpr_ptr until);

  SQLExpr_ptr getIterate();

  void setIterate(SQLExpr_ptr iterate);

  ModelClause_ModelRuleOption_list_ptr getOptions();

  ModelClause_CellAssignmentItem_list_ptr getCellAssignmentItems();

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_ModelRuleOption
{
public:
  static ModelClause_ModelRuleOption_ptr UPSERT;
  static ModelClause_ModelRuleOption_ptr UPDATE;
  static ModelClause_ModelRuleOption_ptr AUTOMATIC_ORDER;
  static ModelClause_ModelRuleOption_ptr SEQUENTIAL_ORDER;

  string_ptr name;
  uint64_t mask;

  ModelClause_ModelRuleOption(uint64_t mask, string_ptr name);

  string_ptr toString();
};

class ModelClause_CellAssignmentItem : virtual public OracleSQLObjectImpl
{
public:
  ModelClause_ModelRuleOption_ptr option;
  ModelClause_CellAssignment_ptr cellAssignment;
  SQLOrderBy_ptr orderBy;
  SQLExpr_ptr expr;

  SHAREDOBJECT(ModelClause_CellAssignmentItem);
  ModelClause_ModelRuleOption_ptr getOption();

  void setOption(ModelClause_ModelRuleOption_ptr option);

  ModelClause_CellAssignment_ptr getCellAssignment();

  void setCellAssignment(ModelClause_CellAssignment_ptr cellAssignment);

  SQLOrderBy_ptr getOrderBy();

  void setOrderBy(SQLOrderBy_ptr orderBy);

  SQLExpr_ptr getExpr();

  void setExpr(SQLExpr_ptr expr);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);
};

class ModelClause_CellAssignment : virtual public SQLExprImpl, virtual public OracleExpr, virtual public SQLReplaceable
{
public:
  SQLExpr_ptr measureColumn;
  SQLExpr_list_ptr conditions;

  ModelClause_CellAssignment();
  SHAREDOBJECT(ModelClause_CellAssignment);

  SQLExpr_list_ptr getConditions();

  SQLExpr_ptr getMeasureColumn();

  void setMeasureColumn(SQLExpr_ptr e);

  // @Override
  BOOL_ptr replace(SQLExpr_ptr expr, SQLExpr_ptr target);

  // @Override
  void accept0(OracleASTVisitor_ptr visitor);

  // @Override
  bool equals(Object_ptr o);

  // @Override
  int hashCode();

  // @Override
  void accept0(SQLASTVisitor_ptr visitor);

  // @Override
  SQLObject_ptr clone();

  // @Override
  SQLObject_list_ptr getChildren();
};

class ModelClause : virtual public OracleSQLObjectImpl
{
public:
  ModelClause_CellReferenceOption_list_ptr cellReferenceOptions;
  ModelClause_ReturnRowsClause_ptr returnRowsClause;
  ModelClause_ReferenceModelClause_list_ptr referenceModelClauses;
  ModelClause_MainModelClause_ptr mainModel;

  ModelClause();
  SHAREDOBJECT(ModelClause);
  
  // @Override
  void accept0(OracleASTVisitor_ptr visitor);

  ModelClause_MainModelClause_ptr getMainModel();

  void setMainModel(ModelClause_MainModelClause_ptr mainModel);

  ModelClause_ReturnRowsClause_ptr getReturnRowsClause();

  void setReturnRowsClause(ModelClause_ReturnRowsClause_ptr returnRowsClause);

  ModelClause_ReferenceModelClause_list_ptr getReferenceModelClauses();

  ModelClause_CellReferenceOption_list_ptr getCellReferenceOptions();

  SQLObject_ptr clone();
};
